import { resetRouter } from '@/router'
import useUserStore from '@/stores/modules/user'
import cache from './cache'
// 本地缓冲key
//token
export const TOKEN_KEY = 'token'
//账号
export const ACCOUNT_KEY = 'account'
//设置
export const SETTING_KEY = 'setting'

export function getToken() {
  return cache.get(TOKEN_KEY)
}
export function clearAuthInfo() {
  const userStore = useUserStore()
  // const tabsStore = useTabsStore()
  userStore.resetState()
  // tabsStore.$reset()
  cache.remove(TOKEN_KEY)
  resetRouter()
}
